﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MusicDownloaderFix
{
    public partial class frmOption : Form
    {
        public frmOption()
        {
            InitializeComponent();
        }

        private void Option_Load(object sender, EventArgs e)
        {
            spinEdit1.Properties.MinValue = 1;
            spinEdit1.Properties.MaxValue = 10;

            //if (radioGroup1.SelectedIndex == 0)
            //{
            //    MessageBox.Show("test");
            //}
            
        }

        private void btnBrowseSaveTo_Click(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            FolderBrowserDialog dialog = new FolderBrowserDialog();

            dialog.Description = "Select folder for save file";

            if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                frmMain.strSaveTo = txtSaveTo.Text = dialog.SelectedPath;
            }
        }

        private void btnBrowseIDM_Click(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog();

            dialog.Title = "Please selete file downloader";
            dialog.Filter = "Excute|IDMan.exe";

            if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                frmMain.strIDM = txtIDM.Text = dialog.FileName;
            }
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            frmMain.maxDownload = (int)spinEdit1.Value;
            frmMain.bIDM = checkEdit1.Checked;
            this.Close();
        }

        
    }
}
